import { handle } from '../../index'

const suffix = 'api'

// 分页
export const rolesGetByPage = (params: any) => handle({
  url: `/${suffix}/roles/getByPage`,
  method: 'get',
  params
})
// 详情
export const rolesGetRoleById = (id: any) => handle({
  url: `/${suffix}/roles/getRoleById/${id}`,
  method: 'get',
})
// 新增
export const rolesCreate = (params: any) => handle({
  url: `/${suffix}/roles/create`,
  method: 'post',
  params
})
// 编辑
export const rolesUpdate = (params: any) => handle({
  url: `/${suffix}/roles/update`,
  method: 'post',
  params
})
// 删除
export const rolesDelete = (id: any) => handle({
  url: `/${suffix}/roles/delete/${id}`,
  method: 'get',
})
// 授权
export const rolesDoAuthorization = (params: any) => handle({
  url: `/${suffix}/roles/doAuthorization`,
  method: 'post',
  params
})
// 授权查看
export const rolesFindAllByRoleId = (id: any) => handle({
  url: `/${suffix}/roles/findAllByRoleId/${id}`,
  method: 'get',
})